using Admin.Domain.Entities;
using Admin.Domain.Repositories;
using Admin.Infrastructure.Date;

namespace Admin.Infrastructure.Repositories;

public class SystemLogRepository(AdminDbContext db) : ISystemLogRepository
{
    private readonly AdminDbContext _db = db;

    public async Task AddAsync(string msg)
    {
        var log = SystemLog.Create(msg);
        await _db.SystemLogs.AddAsync(log);
        await _db.SaveChangesAsync();
    }
}